/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.dinner.entity.commodity;

import com.thinkgem.jeesite.modules.cms.utils.CmsUtils;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 商品管理Entity
 * @author dai
 * @version 2018-11-22
 */
public class ResCommodity extends DataEntity<ResCommodity> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 商品名称
	private String type;		// 商品类型
	private String price;		// 价格
	private String picId;		// 缩略图
	
	public ResCommodity() {
		super();
	}

	public ResCommodity(String id){
		super(id);
	}

	@Length(min=1, max=200, message="商品名称长度必须介于 1 和 200 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=1, max=64, message="商品类型长度必须介于 1 和 64 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}
	
	@Length(min=0, max=255, message="缩略图长度必须介于 0 和 255 之间")
	public String getPicId() {
		return picId;
	}

	public void setPicId(String picId) {
		this.picId = picId;
	}
	public String getImageSrc() {
		return CmsUtils.formatImageSrcToWeb(this.picId);
	}
}